package cn.wen.yinxiu.system.controller;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import cn.wen.yinxiu.common.constant.ParamConstants;
import cn.wen.yinxiu.common.convention.result.Results;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import cn.wen.yinxiu.system.entity.SysParamsEntity;
import cn.wen.yinxiu.system.service.SysParamsService;
import cn.wen.yinxiu.common.toolkit.PageUtils;
import cn.wen.yinxiu.common.convention.result.ResultEntity;

/**
 *
 * @ClassName: SysParamsController
 * @Author 小飞
 * @Email coderwen22@163.com
 * @Date 2023-05-22 09:46:50
 * @Description: 参数配置表的Controller层
 */
@RestController
@RequestMapping("web")
public class SysParamsController {

    @Autowired
    private SysParamsService sysParamsService;

    /**
     * 获取用户创作中心 首页轮播图数据
     * @return
     */
    @GetMapping("/api/serve/system/home/carousel")
    ResultEntity<List<String>> getSystemServeHomeCarousel() {
        // 传入Key值获取对应的Value数据
        List<String> res = sysParamsService.getSystemCarouselParams(ParamConstants.PARAM_SERVE_HOME_CAROUSEL_KEY);
        return Results.success(res);
    }

}
